package exception_exercise;

import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始");
        try(FileOutputStream fos2=new FileOutputStream("fos2.dat");){
            fos2.write(2);
        }catch (IOException e2){
            e2.printStackTrace();
        }
        System.out.println("程序结束");
    }
}
